home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 21
/
CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso
/
CUCD
/
Programming
/
PPCcforth
/
l2b.c
< prev
next >
Wrap
C/C++ Source or Header
|
1985-12-27
|
674b
|
29 lines
/* usage: line2block < linefile > blockfile
* takes a file (like one generated by block2line) of the form:
* <header line>
* < 16 screen lines >
* ...
* and produces a block file with exactly 64 characters on each line, having
* removed the header lines. This file is suitable for use with FORTH as a
* block file.
*/
#include <stdio.h>
main()
{
int i;
char buf[65];
char *spaces = /* 64 spaces, below */
" ";
/* 64 spaces, above */
while (1) {
gets(buf); /* header line */
for (i=0; i<16; i++) {
if (gets(buf) == NULL) exit(0);
printf("%s%s",buf,spaces+strlen(buf));
}
}
}